package com.example.auth.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * sys-menu
 *
 * @author cuihaida
 */
@Data
public class SysMenu {

    /**
     * menu ID
     */
    private Long id;

    /**
     * menu name
     */
    private String name;

    /**
     * menu code
     */
    private String code;

    /**
     * menu type
     */
    private Integer type;

    /**
     * menu icon
     */
    private String icon;

    /**
     * the router path of menu
     */
    private String path;

    /**
     * the component of menu
     */
    private String component;

    /**
     * is hidden the sidebar?
     */
    private Boolean hidden;

    /**
     * parent menu id
     */
    private Long parentId;

    /**
     * display order number
     */
    private Integer orderNum;

    /**
     * create time
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**
     * children menu list
     */
    private List<SysMenu> children = new ArrayList<>();
}
